import 'package:flutter/material.dart';

class ContainerDemo extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(

      appBar: AppBar(title: Text('ContainerDemo'),),

      body: Center(

        child: Container(

          margin: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),

          constraints: BoxConstraints.tightFor(width: 200, height: 150),

          decoration: BoxDecoration(

            ///渐变
              gradient: RadialGradient(

                colors: <Color>[Colors.red, Colors.black],

                ///控制从哪里开始渐变
                center: Alignment.topLeft,

                radius: 10,
              ),

              ///阴影
              boxShadow: [

                BoxShadow(

                  color: Colors.black,
                  offset: Offset(2.0, 2.0),
                  blurRadius: 5,
                )
              ]
          ),

          ///变换
          transform: Matrix4.rotationZ(0.5),

          ///子组件的位置
          alignment: Alignment.center,

          child: Text("5.20", style: TextStyle(color: Colors.white, fontSize: 40.0),


          ),
        ),
      )
    );
  }
}